home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12800 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  30 lines

  1. Newsgroups: comp.lang.c
  2. Path: thinkage.on.ca!atbowler
  3. From: atbowler@thinkage.on.ca (Alan Bowler)
  4. Subject: Re: Is this a C BUG??? (A string issue)
  5. Message-ID: <Dp964J.9tH@thinkage.on.ca>
  6. Sender: news@thinkage.on.ca
  7. Organization: Thinkage Ltd.
  8. References: <4jknpf$9k3@abel.cc.sunysb.edu> <4jmjgfINN8pr@keats.ugrad.cs.ubc.ca> <AD84A72A96681716E4@mcdiala03.it.luc.edu>
  9. Date: Tue, 2 Apr 1996 20:55:30 GMT
  10.  
  11. In article <AD84A72A96681716E4@mcdiala03.it.luc.edu> VArase@varase.it.luc.edu (Verne Arase) writes:
  12. >In article <4jmjgfINN8pr@keats.ugrad.cs.ubc.ca>,
  13. >c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote:
  14. >
  15. > >When in doubt, process individual characters rather than being clever
  16. >with
  17. > >buffers and string manipulation. It can be more efficient and cleaner.
  18. >
  19. >Even better for fixed length records is open/read/write/close. You can even
  20. >use non-delimited records. (Why waste the space of a line delimiter, if
  21. >you're not going to use character formatted data?)
  22.  
  23. While there may be a point in omitting the line delimiter, you should
  24. use fopen/fclose/fread/fwrite.  open/read/write/close are system calls
  25. on many systems (Unix ones), and the overhead of getting in and out of
  26. the operation system on each call will swamp any inefficiencies you
  27. were tryiung to avoid with single character manipulations.  On other
  28. systems open/read/write/close may not exist, or may have some other
  29. very surprising effects.  
  30.